# example6_22_fill_between.py
# coding=utf-8
import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(0, 35, 100)
y = x**2 + 2 * x - 100  # 曲线定义
y1 = y + 100  # 生成上边界曲线
y2 = y - 100  # 生成下边界曲线
y3 = y - 300
plt.plot(x, y, "b")
plt.plot(x, y1, "r--")
plt.plot(x, y2, "g--")
plt.plot(x, y3, "r-.")
plt.fill_between(x, y1, y2, facecolor="yellow", alpha=0.2)
plt.fill_between(x, y3, facecolor="green", alpha=0.15)
plt.show()
